from turtle import Pen
from math import sqrt
def  rolling(pen, sunPos, earthPos, speed):
 vx=speed[0];  vy=speed[1]
 x=earthPos[0];  y=earthPos[1]
 pen.up();  pen.goto(sunPos[0]/100, sunPos[1]/100);
 pen.down();   pen.circle(3);  pen.up()
 pen.goto(x/100,y/100); pen.color("red"); pen.down()
 raw_input("Press [ENTER] to begin");  counter=0
 while counter<2**30:
  lenth=sqrt((sunPos[0]-x)**2+(sunPos[1]-y)**2)
  f=10000000000.0/(lenth**2);  print f
  ax=f*(sunPos[0]-x)/lenth
  ay=f*(sunPos[1]-y)/lenth
  time=min( 1/max( abs(vx), abs(vy) ),  1/max( abs(ax), abs(ay) ) )
  x=x+time*vx;     y=y+time*vy
  vx=vx+time*ax;   vy=vy+time*ay
  pen.goto(x/100, y/100)
  counter+=1
  if counter%10000==0:
   raw_input("Press [ENTER] to print more")
rolling(Pen(), (-10000,-2000), (10000,-2000),  (0,400))

